# Generated by Django 5.0.2 on 2024-02-24 13:38

import core.models
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Project",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("name", models.CharField(max_length=150, verbose_name="название")),
                ("code", models.CharField(max_length=5, verbose_name="код проекта")),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="когда создан"),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="projects",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="кем создан",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="ShotGroup",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("name", models.CharField(max_length=50, verbose_name="название группы шотов")),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="когда создан"),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_shot_groups",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="кем создан",
                    ),
                ),
                (
                    "project",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="shot_groups",
                        to="core.project",
                        verbose_name="проект",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Shot",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("name", models.CharField(max_length=50, verbose_name="Название шота")),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="когда создан"),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="created_shots",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="кем создан",
                    ),
                ),
                (
                    "group",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="shots",
                        to="core.shotgroup",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Version",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("name", models.CharField(max_length=50, verbose_name="Название версии")),
                ("video", models.FileField(upload_to=core.models.version_upload_path)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "created_by",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_versions",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "shot",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="versions",
                        to="core.shot",
                    ),
                ),
            ],
        ),
    ]
